﻿@model CultuRAM.Models.Resource

@{
    ViewBag.Title = "Editar Recurso";

}

<h4>Editar Recurso</h4>
<br />
@using (Ajax.BeginForm("EditPv", "Resource", new AjaxOptions
{
    UpdateTargetId = "tabEventResRight",
    InsertionMode = InsertionMode.Replace,
    HttpMethod = "POST",
    OnSuccess = "UpdateEventRes(" + @Model.EventId + ")"
}))
{
    @*@Html.ValidationSummary(false)*@

    <fieldset>
        <legend>Sessão</legend>
        
        @Html.HiddenFor(model => model.ResId)
        @Html.HiddenFor(model => model.EventId, new { id = "EventId" }) @*//NAO ALTERAR*@
        
        
        <div class="control-group">
            @Html.LabelFor(model => model.Name)     
            <div class="controls">
                @Html.TextBoxFor(model => model.Name, null, new {@style = "width: 510px !important;" })
                @*@Html.ValidationMessageFor(model => model.Title)*@
            </div>
        </div>
            
        <div class="control-group">
            @Html.LabelFor(model => model.ResourceType)
            <div class="controls">
                @Html.DropDownListFor(model => model.ResTypeId, (SelectList)ViewBag.ResourceTypes, "- Selecione -", new { id = "ResTypeId"})
                @*@Html.HiddenFor(model => model.ResTypeId)*@
                @Html.ValidationMessageFor(model => model.ResourceType.ResTypeId)      
            </div>
        </div>


        <div class="control-group">
            @Html.LabelFor(model => model.File)
                
            <div class="controls">
                @Html.TextBoxFor(model => model.File, null, new {@style = "width: 510px !important;", @type="file" })
                @*@Html.ValidationMessageFor(model => model.Duration)*@
            </div>
        </div>  

 <br/>
        <p>
            <button  type="submit" value="Guardar" class="btn btn-primary"><i class="icon-ok icon-white"></i> Guardar</button>
            
            @Html.Raw(@Ajax.ActionLink("replacetxt", "Default", null, new AjaxOptions()
            {
                UpdateTargetId = "tabEventResRight",
                InsertionMode = InsertionMode.Replace,
                OnSuccess = "ResBgColorClear()",
            }, new { @class = "btn btn-default" })
		            .ToHtmlString().Replace("replacetxt", "<i class=\"icon-ban-circle\"></i> Cancelar"))

        </p>
    </fieldset>
}



@Scripts.Render("~/bundles/culturam")


